<div class="navbar navbar-default">
<security:authentication property="name" var="user"/>
<c:choose>
    <c:when test="${user == 'anonymousUser'}">
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="http://quarcum.dyndns.org:8087/vxBug/">vxBug</a>
        </div>
        <div class="navbar-collapse collapse">
            <form class="navbar-form navbar-right" role="form" method="POST" action="<c:url value="/j_spring_security_check" />">
                <div class="form-group">
                    <input type="text" placeholder="Login" class="form-control" name="j_username">
                </div>
                <div class="form-group">
                    <input type="password" placeholder="Password" class="form-control" name="j_password">
                </div>
                <button type="submit" class="btn btn-success">Sign in</button>
            </form>
        </div><!--/.navbar-collapse -->
    </div>
</div>
    </c:when>
    <c:otherwise>
        <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">vxBug</a>
                </div>
                <div class="navbar-collapse collapse">
                    <form class="navbar-form navbar-right" role="form" method="POST" action="<c:url value="/j_spring_security_logout" />">
                        <button type="submit" class="btn btn-success">Logout</button>
                    </form>
                    <p class="navbar-text navbar-right"><c:out value="${user}"/><security:authorize ifAllGranted="ROLE_ADMIN">(Admin)</security:authorize></p>
                </div><!--/.navbar-collapse -->
            </div>
        </div>
        </c:otherwise>
    </c:choose>
    </div>